﻿using System.Data;

namespace Inaction
{
    public abstract class SqlCommand : Core.IDbQuerable
    {
        protected abstract void DoExecute(IDbConnection connection);

        public static T Execute<T>(T command) where T : SqlCommand
        {
            return (T)Inaction.Proxy.Excute(command);
        }

        internal void Execute()
        {
            DoExecute(DbProvider.Instance.Connection);
        }

        #region IDbQuerable
        public string ParaFix
        {
            get { return Inaction.DbProvider.Instance.ParaFix; }
        }
        #endregion
    }
}
